home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Data 2002 May / CD Rom Data Mayıs 2002.iso / Freeware / Blitz Basic / data1.cab / Support / help / samples / scrolling_backdrop.bb < prev    next >
Encoding:
Text File  |  2002-04-10  |  549 b   |  33 lines

  1. ;a simple scrolling backdrop
  2. ; verified 1.48 4/18/2001
  3. ;
  4. ;hit ESC to exit
  5.  
  6. ;go into graphics mode
  7. Graphics 640,480
  8.  
  9. ;enable double buffering
  10. SetBuffer BackBuffer()
  11.  
  12. ;load in a backdrop image
  13. backdrop=LoadImage("graphics\stars.bmp")
  14.  
  15. ;initialize scroll variable to 0
  16. scroll_y=0
  17.  
  18. ;loop until ESC hit
  19. While Not KeyDown(1)
  20.  
  21.     ;draw the backdrop
  22.     TileBlock backdrop,0,scroll_y
  23.     
  24.     ;scroll the backdrop
  25.     scroll_y=scroll_y+1
  26.     If scroll_y=ImageHeight(backdrop) Then scroll_y=0
  27.     
  28.     ;flip the front and back buffers
  29.     Flip
  30.  
  31. Wend
  32.  
  33.